home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / RIncludes / SIOW.r < prev    next >
Encoding:
Text File  |  1994-04-16  |  8.2 KB  |  420 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Input/Output Window
  6. #
  7. #    SIOW
  8. #
  9. #    Copyright:    © 1989-1993 by Apple Computer, Inc., all rights reserved.
  10. #
  11. ------------------------------------------------------------------------------*/
  12.  
  13. #include "systypes.r"
  14. #include "types.r"
  15.  
  16. #include "SIOW.h"
  17.  
  18. #ifndef CREATOR
  19.     #define CREATOR 'siow'
  20. #endif
  21.  
  22. #ifndef FCREATOR
  23.     #define FCREATOR 'MPS '
  24. #endif
  25.  
  26. type 'pzza' {
  27.     literal longint;
  28. };
  29.  
  30. resource 'pzza' (128, purgeable) {
  31.     FCREATOR;
  32. };
  33.  
  34. /* we use an MBAR resource to conveniently load all the menus */
  35.  
  36. resource 'MBAR' (__rMenuBar, preload) {
  37.     { __mApple, __mFile, __mEdit, __mFont /*, __mSize */};        /* five menus */
  38. };
  39.  
  40.  
  41. resource 'MENU' (__mApple, preload) {
  42.     __mApple, textMenuProc,
  43.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  44.     enabled, apple,
  45.     {
  46.         "About S I O W\311",
  47.             noicon, nokey, nomark, plain;
  48.         "-",
  49.             noicon, nokey, nomark, plain
  50.     }
  51. };
  52.  
  53. resource 'MENU' (__mFile, preload) {
  54.     __mFile, textMenuProc,
  55.     0b000000000000000000000000000000,    /* enable Quit only, program enables others */
  56.     enabled, "File",
  57.     {
  58.         "New",
  59.             noicon, "N", nomark, plain;
  60.         "Open",
  61.             noicon, "O", nomark, plain;
  62.         "-",
  63.             noicon, nokey, nomark, plain;
  64.         "Close",
  65.             noicon, "W", nomark, plain;
  66.         "Save",
  67.             noicon, "S", nomark, plain;
  68.         "Save As\311",
  69.             noicon, nokey, nomark, plain;
  70.         "-",
  71.             noicon, nokey, nomark, plain;
  72.         "Page Setup\311",
  73.             noicon, nokey, nomark, plain;
  74. // 12/13/93 - Added Command-P equivalent to Print item
  75.         "Print\311",
  76.             noicon, "P", nomark, plain;
  77.         "-",
  78.             noicon, nokey, nomark, plain;
  79.         "Quit",
  80.             noicon, "Q", nomark, plain
  81.     }
  82. };
  83.  
  84. resource 'MENU' (__mEdit, preload) {
  85.     __mEdit, textMenuProc,
  86.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  87.     enabled, "Edit",
  88.      {
  89.         "Undo",
  90.             noicon, "Z", nomark, plain;
  91.         "-",
  92.             noicon, nokey, nomark, plain;
  93.         "Cut",
  94.             noicon, "X", nomark, plain;
  95.         "Copy",
  96.             noicon, "C", nomark, plain;
  97.         "Paste",
  98.             noicon, "V", nomark, plain;
  99.         "Clear",
  100.             noicon, nokey, nomark, plain
  101.     }
  102. };
  103.  
  104. resource 'MENU' (__mFont, preload) {
  105.     __mFont, textMenuProc,
  106.     0b1111111111111111111111111111111,    /* enable everything */
  107.     enabled, "Font",
  108.      {
  109.      }
  110. };
  111.  
  112. /* this ALRT and DITL are used as an About screen */
  113.  
  114. resource 'ALRT' (__rAboutAlert, purgeable) {
  115. // 12/13/93 - GAB: support for native PowerPC version
  116. #ifdef APPNAME    // taller dialog for PowerPC version
  117.     {66, 58, 354, 396},
  118. #else
  119.     {66, 58, 344, 396},
  120. #endif
  121.      __rAboutAlert, {
  122.         OK, visible, silent;
  123.         OK, visible, silent;
  124.         OK, visible, silent;
  125.         OK, visible, silent
  126.     };
  127. };
  128.  
  129. resource 'DITL' (__rAboutAlert, purgeable) {
  130.     {    /* array DITLarray: 10 elements */
  131.         /* [1] */
  132. // 12/13/93 - GAB: support for native PowerPC version
  133. #ifdef APPNAME    // taller dialog for PowerPC version
  134.         {260, 129, 280, 209},
  135. #else
  136.         {233, 144, 253, 224},
  137. #endif
  138.         Button {
  139.             enabled,
  140.             "OK"
  141.         },
  142.         /* [2] */
  143.         {8, 72, 23, 264},
  144.         StaticText {
  145.             disabled,
  146.             "Simple Input/Output Window"
  147.         },
  148.         /* [3] */
  149.         {56, 24, 71, 337},
  150.         StaticText {
  151.             disabled,
  152.             $$Format("Copyright ©Apple Computer, Inc. 1989-%d ", $$Year)
  153.         },
  154.         /* [4] */
  155.         {80, 108, 96, 244},
  156.         StaticText {
  157.             disabled,
  158.             "Brought to you by..."
  159.         },
  160.         /* [5] */
  161.         {109, 132, 134, 229},
  162.         StaticText {
  163.             disabled,
  164.             "\"PZZA SLT\""
  165.         },
  166.         /* [6] */
  167.         {152, 24, 170, 212},
  168.         StaticText {
  169.             disabled,
  170.             "Special Thanks to..."
  171.         },
  172.         /* [7] */
  173.         {176, 56, 194, 289},
  174.         StaticText {
  175.             disabled,
  176.             "Roger, Russ, Landon, Ira & Munch"
  177.         },
  178. // 12/13/93 - GAB: support for native PowerPC version
  179. #ifdef APPNAME    // for native PowerPC build only
  180.         /* [8] */
  181.         {200, 24, 218, 212},
  182.         StaticText {
  183.             disabled,
  184.             "PowerPC port by…"
  185.         },
  186.         /* [9] */
  187.         {224, 56, 242, 289},
  188.         StaticText {
  189.             disabled,
  190.             "Greg Branche"
  191.         },
  192. #endif
  193.         /* [10] */
  194.         {32, 152, 47, 200},
  195.         StaticText {
  196.             disabled,
  197.             "(SIOW)"
  198.         }
  199.     }
  200. };
  201.  
  202. /* this ALRT and DITL are used as an error screen */
  203.  
  204. resource 'ALRT' (__rUserAlert, purgeable) {
  205.     {40, 20, 150, 260},
  206.     __rUserAlert,
  207.     { /* array: 4 elements */
  208.         /* [1] */
  209.         OK, visible, silent,
  210.         /* [2] */
  211.         OK, visible, silent,
  212.         /* [3] */
  213.         OK, visible, silent,
  214.         /* [4] */
  215.         OK, visible, silent
  216.     }
  217. };
  218.  
  219.  
  220. resource 'DITL' (__rUserAlert, purgeable) {
  221.     { /* array DITLarray: 3 elements */
  222.         /* [1] */
  223.         {80, 150, 100, 230},
  224.         Button {
  225.             enabled,
  226.             "OK"
  227.         },
  228.         /* [2] */
  229.         {10, 60, 60, 230},
  230.         StaticText {
  231.             disabled,
  232.             "Error. ^0."
  233.         },
  234.         /* [3] */
  235.         {8, 8, 40, 40},
  236.         Icon {
  237.             disabled,
  238.             2
  239.         }
  240.     }
  241. };
  242.  
  243.  
  244. #define WindowHeight     286
  245. #define WindowWidth        480
  246.  
  247. resource 'WIND' (__rDocWindow, preload, purgeable) {
  248.     {0, 0, WindowHeight, WindowWidth},
  249.     zoomDocProc, invisible, noGoAway, 0x0, "untitled"
  250. };
  251.  
  252. resource 'CNTL' (__rVScroll, preload, purgeable) {
  253.     {-1, WindowWidth-15, WindowHeight-14, WindowWidth+1},
  254.     0, invisible, 0, 0, scrollBarProc, 0, ""
  255. };
  256.  
  257. resource 'CNTL' (__rHScroll, preload, purgeable) {
  258.     {WindowHeight-15, -1, WindowHeight+1, WindowWidth-14},
  259.     0, invisible, 0, 0, scrollBarProc, 0, ""
  260. };
  261.  
  262. resource 'STR#' (__kErrStrings, purgeable) {
  263.     {
  264.     "You must run on 512Ke or later";
  265.     "Application Memory Size is too small";
  266.     "Not enough memory to run SIOW";
  267.     "Not enough memory to do Cut";
  268.     "Cannot do Cut";
  269.     "Cannot do Copy";
  270.     "Cannot exceed 32,000 characters with Paste";
  271.     "Not enough memory to do Paste";
  272.     "Cannot create window";
  273.     "Cannot exceed 32,000 characters";
  274.     "Cannot do Paste";
  275.     "Font not found";
  276.     "Cannot exceed request count during input - text truncated"
  277.     }
  278. };
  279.  
  280. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  281.  
  282. resource 'SIZE' (-1) {
  283.     dontSaveScreen,
  284.     acceptSuspendResumeEvents,
  285.     enableOptionSwitch,
  286.     canBackground,                /* we can background; we don't currently, but our sleep value */
  287.                                 /* guarantees we don't hog the Mac while we are in the background */
  288.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  289.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  290.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  291.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  292.     is32BitCompatible,            /* this app should not be run in 32-bit address space */
  293.     reserved,
  294.     reserved,
  295.     reserved,
  296.     reserved,
  297.     reserved,
  298.     reserved,
  299.     reserved,
  300.     __kPrefSize * 1024,
  301.     __kMinSize * 1024    
  302. };
  303.  
  304.  
  305. type CREATOR as 'STR ';
  306.  
  307.  
  308. resource CREATOR (0) {
  309.     "MultiFinder-Aware Simple Input/Output Window (SIOW)"
  310. };
  311.  
  312.  
  313. resource 'BNDL' (128) {
  314.     CREATOR,
  315.     0,
  316.     {
  317.         'ICN#',
  318.         {
  319.             0, 128
  320.         },
  321.         'FREF',
  322.         {
  323.             0, 128
  324.         }
  325.     }
  326. };
  327.  
  328.  
  329. resource 'FREF' (128) {
  330.     'APPL',
  331.     0,
  332.     ""
  333. };
  334.  
  335.  
  336. resource 'ICN#' (128) {
  337.     {    /* array: 2 elements */
  338.         /* [1] */
  339.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  340.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  341.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  342.         $"00FF FF00 03FF FFE0 0791 03F0 0ED1 0E7C"
  343.         $"1C31 321C 380D C10E 3FFF FFFE 3003 C106"
  344.         $"380D 300E 1E31 0E3C 1FC1 01F8 07FF FFE0"
  345.         $"00FF FE00",
  346.         /* [2] */
  347.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  348.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  349.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  350.         $"00FF FF00 03FF FFE0 07FF FFF0 0FFF FFFC"
  351.         $"1FFF FFFC 3FFF FFFE 3FFF FFFE 3FFF FFFE"
  352.         $"3FFF FFFE 1FFF FFFC 1FFF FFF8 07FF FFE0"
  353.         $"00FF FE00"
  354.     }
  355. };
  356.  
  357. resource 'ALRT' (__rSaveAlert, preload) {
  358.     {72, 64, 212, 372},
  359.     __rSaveAlert,
  360.     {    /* array: 4 elements */
  361.         /* [1] */
  362.         OK, visible, silent,
  363.         /* [2] */
  364.         OK, visible, silent,
  365.         /* [3] */
  366.         OK, visible, silent,
  367.         /* [4] */
  368.         OK, visible, silent
  369.     }
  370. };
  371.  
  372. resource 'DITL' (__rSaveAlert, preload) {
  373.     {    /* array DITLarray: 4 elements */
  374.         /* [1] */
  375.         {58, 25, 76, 99},
  376.         Button {
  377.             enabled,
  378.             "Yes"
  379.         },
  380.         /* [2] */
  381.         {86, 25, 104, 99},
  382.         Button {
  383.             enabled,
  384.             "No"
  385.         },
  386.         /* [3] */
  387.         {12, 20, 45, 277},
  388.         StaticText {
  389.             disabled,
  390.             "Save changes before closing?"
  391.         },
  392.         /* [4] */
  393.         {86, 195, 104, 269},
  394.         Button {
  395.             enabled,
  396.             "Cancel"
  397.         }
  398.     }
  399. };
  400.  
  401.  
  402. // 12/13/93 - GAB: Support for native PowerPC version
  403.  
  404. #ifdef APPNAME    // only include 'cfrg' in native PowerPC apps
  405.  
  406. #include "CodeFragmentTypes.r"
  407.  
  408. resource 'cfrg' (0) {
  409.     {
  410.         kPowerPC,
  411.         kFullLib,
  412.         kNoVersionNum,kNoVersionNum,
  413.         0,0,
  414.         kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork,
  415.         APPNAME    // must be defined on Rez command line with -d option
  416.     }
  417. };
  418.  
  419. #endif
  420.